package com.xbongbong.paas.pojo.vo;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.constant.PaasConstant;
import com.xbongbong.paas.domain.entity.PaasFormExplainEntity;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.sys.domain.entity.DepartmentEntity;
import com.xbongbong.sys.domain.entity.UserEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author: wufeng
 * @date: 2018/12/13 14:23
 * @desrcption: 关联查询关联数据封装对象
 */
@Getter
@Setter
@ToString
public class LinkResultDataVO implements Serializable {
    private static final long serialVersionUID = 9189622954818010762L;

    /**
     * 关联数据容器
     * 格式：{"text_1": 23, "subForm_1": [{"text_1": 23}]}
     */
    private Map<String, Object> linkData;
    /**
     * 关联查询容器
     */
    private Map<String, Object> linkSearch;

    /**
     * 关联数据的值容器
     */
    private Set<Object> linkDataSet;

    /**
     * 用户容器
     */
    private Map<String, UserEntity> userMap;

    /**
     * 部门容器
     */
    private Map<String, DepartmentEntity> departmentMap;

    /**
     * 数据
     */
    private JSONObject data;

    /**
     * 字段解释
     */
    private List<FieldAttrEntity> explainList;

    /**
     * 字段容器
     */
    private Map<String, FieldAttrEntity> explainMap;

    private List<PaasFormDataEntityExt> formDataList;

    private Map<String, PaasFormExplainEntity> formExplainMap;

    private Map<Long, List<String>> mainUserMap;

    private Map<Long, List<String>> coUserMap;

    public LinkResultDataVO(){
        linkData = new HashMap<>(PaasConstant.DEFAULT_INITIAL_CAPACITY);
        linkDataSet = new HashSet<>();
        formDataList = new ArrayList<>();
        formExplainMap = new HashMap<>(PaasConstant.DEFAULT_INITIAL_CAPACITY);
    }

    public LinkResultDataVO(Map<String, Object> linkData, Map<String, Object> linkSearch, Set<Object> linkDataSet, Map<String, UserEntity> userMap, Map<String, DepartmentEntity> departmentMap, JSONObject data, List<FieldAttrEntity> explainList, Map<String, FieldAttrEntity> explainMap, List<PaasFormDataEntityExt> formDataList, Map<String, PaasFormExplainEntity> formExplainMap, Map<Long, List<String>> mainUserMap, Map<Long, List<String>> coUserMap) {
        this.linkData = linkData;
        this.linkSearch = linkSearch;
        this.linkDataSet = linkDataSet;
        this.userMap = userMap;
        this.departmentMap = departmentMap;
        this.data = data;
        this.explainList = explainList;
        this.explainMap = explainMap;
        this.formDataList = formDataList;
        this.formExplainMap = formExplainMap;
        this.mainUserMap = mainUserMap;
        this.coUserMap = coUserMap;
    }
}
